package demo;

import java.util.Calendar;
import java.util.Date;

import smartbooksdb.exception.MandatoryFieldException;
import smartbooksdb.exception.UserException;
import smartbooksdb.hibernatebean.User;
import smartbooksdb.service.UserService;

public class DemoClass {
	public static void main(String[] args) throws MandatoryFieldException,
			UserException {
		User user = new User();

		user.setUserId(11);
		user.setFirstName(null);
		user.setMiddleName("Khushal");
		user.setLastName("Dedhia");
		user.setUsername("saurabh." + Calendar.getInstance().getTimeInMillis());
		user.setPassword("password1");
		user.setRole("A");
		user.setPhoto(null);
		user.setGender("M");
		user.setDob(new Date());
		user.setAddress("Vile Parle (East)");
		user.setCity("Mumbai");
		user.setState("Maharashtra");
		user.setPhone(26631844L);
		user.setMobile(9870647661L);
		user.setOffice(0L);
		user.setFax(0);
		user.setEmail("dedhia88@gmail.com");
		user.setNotes("");
		user.setPanNumber("ALMPD3425F");
		user.setUpdatedDate(new Date());
		user.setUpdatedBy(1);
		user.setStatus("A");

		UserService userService = new UserService();
		userService.createUser(user);

		System.out.println(userService.getAllUsers());
	}
}